package com.carl.study;


import org.jooq.codegen.GenerationTool;
import org.jooq.meta.jaxb.*;

/**
 * @program: FrameStudy
 * @description: JOOQ代码生成
 * @author: Mr.Carl
 **/
public class JooqCodegen {
    public static void main(String[] args) throws Exception {
        Configuration configuration = new Configuration()
                .withJdbc(new Jdbc()
                        .withDriver("com.mysql.cj.jdbc.Driver")
                        .withUrl("jdbc:mysql://101.43.4.193:3306/jooq")
                        .withUser("root")
                        .withPassword("root"))
                .withGenerator(new Generator()
                        .withDatabase(new Database()
                                .withName("org.jooq.meta.mysql.MySQLDatabase")
                                .withInputSchema("jooq")
                                .withExcludes(""))
                        .withTarget(new Target()
                                .withPackageName("com.carl.study.gen")
                                .withDirectory("src/main/java")));

        GenerationTool.generate(configuration);
    }
}
